import store from '@/store'

// 存/设置
const setToken = tokenStr => {
  store.commit('user/setToken', tokenStr)
}

// 取
const getToken = () => store.state.user.token

// 删
const removeToken = () => {
  store.commit('user/setToken', '')
}

// 存/设置
const setRefreshToken = refreshTokenStr => {
  store.commit('user/setRefreshToken', refreshTokenStr)
}

// 取
const getRefresToken = () => store.state.user.refreshToken

// 删
const removeRefresToken = () => {
  store.commit('user/setRefreshToken', '')
}

// 按需导出
export {
  setToken,
  getToken,
  removeToken,
  setRefreshToken,
  getRefresToken,
  removeRefresToken

}
